package bpm.dao.impl.manage;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import bpm.domain.manage.Dictionary;
import bpm.domain.manage.DictionaryType;
/**
 * 
 * @author ZhaoWangLong Aug 5, 2011
 *
 */
public class DictionaryRowMapper implements RowMapper {
	public Object mapRow(ResultSet rs, int i) throws SQLException {
		Dictionary dict=new Dictionary();
		dict.setId(rs.getString("ID"));
		dict.setCode(rs.getString("CODE"));
		dict.setName(rs.getString("NAME"));
		dict.setPCode(rs.getString("PCODE"));
		DictionaryType dictionaryType=new DictionaryType();
		dictionaryType.setId(rs.getString("TYPE_ID"));
		dict.setDictionaryType(dictionaryType);
		dict.setSortIndex(rs.getInt("SORT_INDEX"));
		dict.setCreateTime(rs.getDate("CREATE_TIME"));
		dict.setLastUpdateTime(rs.getDate("LASTUPDATE_TIME"));
		dict.setDescription(rs.getString("DESCRIPTION"));
		return dict;
	}

}
